package com.tmpt.others.jpivot.tags;
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
/*

import java.io.File;
import java.io.IOException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;

import com.tmpt.utils.FileUtils;
import org.apache.log4j.Logger;
import org.springframework.util.FileCopyUtils;
*/

public class IncludeTag /*extends TagSupport*/ {
    /*String httpParam = "include";
    String prefix = "/WEB-INF/";
    String suffix = ".jsp";
    private static Logger logger;

    public IncludeTag() {
    }

    public String getHttpParam() {
        return this.httpParam;
    }

    public void setHttpParam(String httpParam) {
        this.httpParam = httpParam;
    }

    public int doStartTag() throws JspException {
        try {
            logger.info("enter");
            HttpServletRequest hsr = (HttpServletRequest)this.pageContext.getRequest();
            String name = hsr.getParameter(this.httpParam);
            if (name != null) {
                String uri = this.prefix + name + this.suffix;
                logger.info("including " + uri);

                String webPath = pageContext.getServletContext().getRealPath("/");
                System.out.println("====webPath1:"+webPath);
                System.out.println("====webPath2:"+"/files1/bi/mondrian/"+name+".jsp");
                System.out.println("====webPath3:"+webPath+prefix+name+".jsp");
                File sourceFile = new File("/files1/bi/mondrian/"+name+".jsp");
                if(sourceFile.exists()) {
                    FileCopyUtils.copy(sourceFile, new File(webPath + prefix + name + ".jsp"));
                }
                RequestDispatcher rd = this.pageContext.getRequest().getRequestDispatcher(uri);
                rd.include(this.pageContext.getRequest(), this.pageContext.getResponse());
            }

            logger.info("leave");
            return 0;
        } catch (ServletException var5) {
            logger.error("exception caught", var5);
            throw new JspException(var5);
        } catch (IOException var6) {
            logger.error("exception caught", var6);
            throw new JspException(var6);
        }
    }

    public String getPrefix() {
        return this.prefix;
    }

    public String getSuffix() {
        return this.suffix;
    }

    public void setPrefix(String prefix) {
        this.prefix = prefix;
    }

    public void setSuffix(String suffix) {
        this.suffix = suffix;
    }

    static {
        logger = Logger.getLogger(com.tonbeller.wcf.utils.IncludeTag.class);
    }*/
}
